//
//  ProductNameCell.m
//  
//
//  Created by Abner on 16/4/28.
//
//

#import "ProductNameCell.h"

@implementation ProductNameCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.proNameTf = [[UITextField alloc]init];
        [self.contentView addSubview:self.proNameTf];
        self.proNameTf.placeholder = @"请输入商品名称";
        self.proNameTf.textColor = KAddLeftLbColor;
        self.proNameTf.font = FontSet(16);
        self.proNameTf.frame = CGRectMake(10, 0, ScreenWidth-20, 44);
        [self.proNameTf addTarget:self action:@selector(proNameTfClicked) forControlEvents:UIControlEventEditingChanged];
        
        UIView *line = [[UIView alloc]initWithFrame:CGRectMake(10, 44, ScreenWidth-20, 1)];
        line.backgroundColor = SetColor(249, 249, 249, 1.0);
        [self.contentView addSubview:line];
        
    }
    return self;
}

//“商品名称”输入事件传值
-(void)proNameTfClicked
{
    if (self.proNameTfClickedBlock) {
        self.proNameTfClickedBlock(self);
    }
}
+(instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *indetifier = @"ProductNameCellIdentifier";
    ProductNameCell *cell = [tableView dequeueReusableCellWithIdentifier:indetifier];
    if (!cell) {
        cell = [[ProductNameCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:indetifier];
    }
    return cell;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
